<h1>Articles</h1>

<table width="100%" cellpadding="5px">
  <tr>
	<th>Title</th>
	<th>Content</th>
	<th>Date</th>
	<th>Published</th>
	<th>Author</th>
  </tr>
  
<% for content in @contents %>
  <tr>
    <td><%= link_to content.title || 'blank', :action => 'show', :id => content %></td>
	<td><%= truncate content.content %></td>
	<td><%= content.created_at.to_formatted_s(:short) %></td>
	<td><%= content.published_flag %></td>
	<td><%= content.user.name rescue nil %></td>
  </tr>
<% end %>
</table>

<%= link_to 'Previous page', { :page => @content_pages.current.previous } if @content_pages.current.previous %>
<%= link_to 'Next page', { :page => @content_pages.current.next } if @content_pages.current.next %> 

<br />

<%= link_to 'New Article', :action => 'new' %>
